#ifndef ARC_CACHE_NODE_H
#define ARC_CACHE_NODE_H

#include <memory>
using namespace std;

namespace Cache {

template <typename Key, typename Value> class ArcNode {
private:
    Key key_;
    Value value_;
    size_t accCount_;
    shared_ptr<ArcNode> prev_;
    shared_ptr<ArcNode> next_;

public:
    ArcNode() : accCount_(1), prev_(nullptr), next_(nullptr) {
        // cout << "Successful ArcNode default construct" << endl;
    }

    ArcNode(Key k, Value v) : key_(k), value_(v), prev_(nullptr), next_(nullptr) {
        // cout << "Successful ArcNode construct" << endl;
    }

    Key getKey() const {
        return key_;
    }
    Value getValue() const {
        return value_;
    }
    size_t getAccCount() const {
        return accCount_;
    }

    void setValue(const Value &v) {
        value_ = v;
    }

    void increaseAccCount() {
        accCount_++;
    }

    template <typename K, typename V> friend class ArcLRUPart;

    template <typename K, typename V> friend class ArcLFUPart;
};
} // namespace Cache

#endif